clear,clc

target_origin_file = '/home/li/Documents/Trainning/SADTestFCMap/Scripts/Variability_FS4.mat';
templateDIR = '/mri_projects/ASD_Analysis/Parcellation_template';
outputDIR = '/mri_projects/ASD_Analysis/Results/Variability';

Variability_FS4_mat = load(target_origin_file);

exclude_lh_template = [templateDIR '/lh_network_1_asym_fs4.mgh'];
exclude_rh_template = [templateDIR '/rh_network_1_asym_fs4.mgh'];
[lh_vol, M, mr_parms, volsz] = load_mgh(exclude_lh_template);
[rh_vol, M, mr_parms, volsz] = load_mgh(exclude_rh_template);

tem_lh = Variability_FS4_mat.lh;
tem_rh = Variability_FS4_mat.rh;

tem_lh(find(lh_vol == 1)) = 0.0;
tem_rh(find(rh_vol == 1)) = 0.0;

save_mgh(tem_lh, [outputDIR '/lh_HC_STD_fs4_intra_variability.mgh'], eye(4));
save_mgh(tem_rh, [outputDIR '/rh_HC_STD_fs4_intra_variability.mgh'], eye(4));
